<?php
/**
 * Created by PhpStorm.
 * User: yangjiaming
 * Date: 2018/2/6
 * Time: 16:52
 */

namespace Eagle\Service;


class LoginInfo extends Base
{
    public function getUserId()
    {
        return $this->getField('id');
    }
    public function getUsername()
    {
        return $this->getField('username');
    }
    public function getUserEmail()
    {
        return $this->getField('email');
    }
    public function getField($field)
    {
        $userInfo = RedisHelper::getToken();
        $userInfo = json_decode($userInfo, 1);
        return $userInfo[$field];
    }
}